/**
 * 
 */
package com.jml.springsecurity.core;

import com.jml.springsecurity.core.properties.SecurityProperties;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.security.crypto.password.PasswordEncoder;


@Configuration
@EnableConfigurationProperties(SecurityProperties.class)
public class SecurityCoreConfig {
	@Bean
	public PasswordEncoder passwordEncoder(){
		//BCryptPasswordEncoder可以换成自定义的加密类，但是需要继承PasswordEncoder，
		//在登录模块中用的加密其实就是这里的加密
		return new BCryptPasswordEncoder();
	}
}
